import $http from '@/utils/request'
import dayjs from 'dayjs'
const endTime = dayjs(new Date().valueOf()).format('YYYY-MM-DD')
const yueTime = dayjs(new Date().valueOf()).format('YYYY-MM')
//  工单状态统计
export const ticketStatus = () => {
  return $http({
    url: `/api/task-service/task/taskReportInfo/${yueTime}-01%2000:00:00/${endTime}%2023:59:59`
  })
}
// 销售统计
export const salesStatisticsAPI = () => {
  return $http({
    url: `/api/order-service/report/orderCount?start=${yueTime}-01+00:00:00&end=${endTime}+23:59:59`
  })
}
// 销售额
export const salesAPI = () => {
  return $http({
    url: `/api/order-service/report/orderAmount?start=${yueTime}-01+00:00:00&end=${endTime}+23:59:59`
  })
}
// 商品热榜
export const hotAPI = () => {
  return $http({
    url: `/api/order-service/report/skuTop/10/${yueTime}-01/${endTime}`
  })
}
// 销售数据 周
export const salesDataAPI = (start, end) => {
  return $http({
    url: `/api/order-service/report/amountCollect/1/${start}/${end}`
  })
}
// 销售分部
export const salesDivisionAPI = (start, end) => {
  return $http({
    url: `/api/order-service/report/regionCollect/${start}/${end}`
  })
}
// 合作商点数
export const serviceAPI = () => {
  return $http({
    url: '/api/vm-service/node/nodeCollect'
  })
}

export const num1 = () => {
  return $http({
    url: '/api/vm-service/node/count'
  })
}
export const num2 = () => {
  return $http({
    url: '/api/user-service/partner/count'
  })
}
